<template>
	<view class="page_box">		
		<view class="content_box">
			<scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-box">
				<checkbox-group @change="onSel">
					<view class="block-label">客户设置</view>
					<view style="padding:30rpx 30rpx;margin-bottom:40rpx;background-color:white;">
						<form>
							<view class="uni-form-item uni-column">
								<view class="title">客户简称</view>
								<input class="uni-input" name="input" :value="customerInfo.CustomerName" placeholder="请输入"/>
							</view>
							<view class="uni-form-item uni-column">
								<view class="title">客户页面标题</view>
								<input class="uni-input" name="input" :value="customerInfo.CustomerPageTitle" placeholder="请输入" />
							</view>
						</form>
					</view>
					<view class="block-label">客户商品</view>
					
					<view class="company-item" v-for="(item,index) in productList" :key="index" @click="naviCompany(item)">
						<view class="company-item-pic">
							<image :src="'http://cdn.ewayz.cn:15001/UploadFiles//Store_Files/store/'+item.StoreId+'/Product/show/thumb350_350/'+item.ShowImg"></image>
						</view>
						<view class="company-item-info">
							<view class="info-name">
								{{item.Name}}
							</view>
							<view class="info-career">
								￥ {{item.ShopPrice}}
								
								<view class="info-career iconfont icon-shanchu" style="display:inline;float:right;font-size:24rpx;">删除
								</view>
							</view>
							
						</view>
					</view>
					
					
					
				</checkbox-group>
				<!-- 更多 -->
				<!-- <view v-if="customerList.length" class="cu-load text-gray" :class="loadStatus"></view> -->
			</scroll-view>
		</view>		
		<!-- 自定义底部导航 -->
		<shopro-tabbar></shopro-tabbar>
		<!-- 关注弹窗 -->
		<shopro-float-btn></shopro-float-btn>
		<!-- 连续弹窗提醒 -->
		<shopro-notice-modal></shopro-notice-modal>
		<!-- 登录提示 -->
		<shopro-login-modal></shopro-login-modal>
	</view>
</template>

<script>
import shoproMiniCard from '@/components/shopro-mini-card/shopro-mini-card.vue';
import shoproEmpty from '@/components/shopro-empty/shopro-empty.vue';
export default {
	components: {
		shoproMiniCard,
		shoproEmpty
	},
	data() {
		return {
			isSel: false,
			allSel: false,
			routerTo: this.$Router,
			selList: [],
			emptyData: {
				img: '/static/imgs/empty/empty_goods.png',
				tip: '暂无企业信息'
			},
			customerInfo:{},
			productList:[],
			total: 0,
			loadStatus: '', //loading,over
			currentPage: 1,
			lastPage: 1
		};
	},
	computed: {},
	onShow() {
		this.loadInfo();
	},
	mounted(){
	},
	onHide() {
		this.dealerList = [];
	},
	methods: {
		// init
		loadInfo() {
			let that=this;
			let loadDistributeConfig=function(){
				return new Promise(function(resolve,reject){
					uni.request({
						url: that.$config.API_URL+"DistributeShop/info",
						method:"POST",
						data:{
							id:that.$route.query.code
						},
						success: (result) => {			
							console.log(result.data);
							that.customerInfo=result.data[0];
							resolve(result.data[0].Pid);
						},
						fail:(error)=>{
							reject();
						}
					})
				});
			}
			
			let loadDistributeProducts=function(pids){
				return new Promise(function(resolve,reject){
					uni.request({
						url: that.$config.API_URL+"Product/GetProductList",
						method:"POST",
						data:{
							pids:pids.split(",")
						},
						success: (result) => {			
							console.log(result.data);
							that.productList=result.data;
						},
						fail:(error)=>{
							reject();
						}
					})
				})
			}
			
			loadDistributeConfig()
			.then(loadDistributeProducts);
		},
		// 路由跳转
		jump(path, parmas) {
			this.$Router.push({
				path: path,
				query: parmas
			});
		},
		share(){
			this.showShare=true;
			let url='/pages/app/dealer/index';
			this.showShareUrl=window.location.href.replace("/pages/app/dealer/myCustomer",url);
		}
	}
};
</script>

<style lang="scss">
// @import url('//at.alicdn.com/t/font_956911_py2eooakww9.css');
.head_box {
	height: 70rpx;
	padding: 0 30rpx;

	.count-box {
		font-size: 26rpx;
		color: #999;

		.all-num {
			color: #a8700d;
		}
	}

	.set-btn {
		background: none;
		font-size: 26rpx;
		color: #a8700d;
	}
}

.collect-list {
	padding: 30rpx 20rpx;
	background: #fff;
	margin-bottom: 20rpx;

	.goods-radio {
		transform: scale(0.7);
		margin-right: 20rpx;
	}
	
	.y-start{
		display:flex;
		flex-direction:row;
		flex-wrap:wrap;
		width:100%;
		
		.goods-title{
			display:inline-block;
			width:60%;
			font-size:16px;
			flex-grow:1;
			flex-shrink:1;
		}
		.sub-tip{
			display:inline-block;
			font-size:14px;
			flex-grow:0;
			flex-shrink:0;
			
		}
		.price{
			display:block;
			margin-top:5px;
			font-size:14px;
			color:#FE7C0F;
			width:100%;
		}
		.more-contact{
			margin-top:5px;
			font-size:28rpx;
		}
		.button{
			text-align:right;
			margin-top:20rpx;
			
			text{
				display:inline-block;
				margin-right:20rpx;
				font-size:28rpx;
				
				&:before{
					font-size:32rpx;
					margin-right:10rpx;
				}
			}
		}
	}
}

.tools-box {
	height: 100rpx;
	width: 750rpx;
	padding: 0 20rpx;
	background: #fff;

	.check-all {
		font-size: 26rpx;

		.check-all-radio {
			transform: scale(0.7);
		}
	}

	.close-btn {
		width: 200rpx;
		height: 70rpx;
		background: linear-gradient(90deg, rgba(233, 180, 97, 1), rgba(238, 204, 137, 1));
		box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
		border-radius: 35rpx;
		padding: 0;
		color: rgba(#fff, 0.9);
	}
}

.shareProp{
	position:fixed;
	top:0px;
	bottom:0px;
	left:0px;
	right:0px;
	display:flex;
	align-items:center;
	justify-content:center;
	
	.sharePropBox{
		display:inline-block;
		width:80%;
		// height:200rpx;
		
		padding:30rpx;
		line-height:40rpx;
		font-size:28rpx;
		
		background-color:white;
		border:solid 1px #cccccc;
		
		.shareContent{
			margin-top:10rpx;
			 display:flex;
			 justify-content:space-between;
			.item:nth-of-type(1){
				height:50rpx;
				line-height:50rpx;
				width:80rpx;
				flex-grow:0;
				flex-shrink:0;
				font-size:28rpx;
				
				text-align:left;
				// background-color:#cccccc;
			}
			.item:nth-of-type(2){
				height:50rpx;
				line-height:50rpx;
				flex-grow:1;
				font-size:28rpx;
				background-color:#efefef;
			}
			.item:nth-of-type(3){
				height:50rpx;
				line-height:50rpx;
				width:80rpx;
				flex-grow:0;
				flex-shrink:0;
				font-size:28rpx;
				text-align:center;
				background-color:#cccccc;
			}
			.item:nth-of-type(4){
				
			}
			
		}
	}
}

.block-label{
	height:40rpx;
	line-height:40rpx;
	font-size:32rpx;
	margin-left:30rpx;
	color:#ee6723;
	margin-top:10rpx;
	margin-bottom:20rpx;
	padding-left:15rpx;
	border-left:solid 5rpx #ee6723;
}
.uni-form-item .title {
	padding: 20rpx 0rpx;
}
.uni-input{
	height:60rpx; line-height:60rpx;border:solid 1px #cccccc;
	padding:0rpx 20rpx;
}

.company{
		width:100%;
		padding:20rpx 30rpx;
		text-align:center;
		margin-bottom:50rpx;
		
		&-title{
			width:100%;
			display:inline-block;
			
			&:before{
				content:'';
				display:inline-block;
				width:200rpx;
				height:2rpx;
				background-color:#888888;
				margin-right: 30rpx;
				position: relative;
				top: -10rpx;
			}
			&:after{
				content:'';
				display:inline-block;
				width:200rpx;
				height:2rpx;
				background-color:#888888;
				margin-left: 30rpx;
				position: relative;
				top: -10rpx;
			}
			
			&>text{
				font-size:32rpx;
			}
		}
		
		&-item{
			width:100%;
			display:flex;
			text-align:left;
			padding:20rpx 30rpx;
			padding-bottom:30rpx;
			
			background-color:white;
			border-bottom:solid 1px #efefef;
			
			&-pic{
				width:180rpx;
				height:120rpx;
				margin-right:30rpx;
				
				background-size:cover;
				background-position:center center;
				
				image{
				width:180rpx;
				height:120rpx;
				}
			}
			
			&-info{
				width:100%;
				.info-name{
					width:100%;
					text-align:justify;
				}
				.info-career{
					font-size:28rpx;
					line-height:40rpx;
					color:#888888;
				}
				.info-subtitle{
					color:#888888;
				}
				.info-tags{
					.tag-item{
						margin-right:10rpx;
					}
				}
			}
		}
	}
</style>
